#!/usr/bin/env bash

# chkconfig: 2345 99 01
# description: Juniper Network Virtualization API

sock_file=/tmp/supervisord_config.sock
if [ ! -e "$sock_file" ]; then
    sock_file=/var/run/supervisord_config.sock
fi
processname=`basename ${0}`
for prs in `supervisorctl -s unix://$sock_file status | grep $processname | awk '{ print $1}'`
do
    supervisorctl -s unix://$sock_file ${1} $prs
done
